package com.beverages.messages.client;

import com.beverages.messages.common.Result;
import com.beverages.messages.config.FeignOkHttpConfig;
import com.beverages.messages.entity.intermediate.Commodity;
import com.beverages.messages.entity.intermediate.Toppings;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "merchant-commodities-service", url = "${merchant.commodities.service.url}", configuration = FeignOkHttpConfig.class)
public interface MerchantCommoditiesClient {

    @GetMapping("/merchant/commodities/id/{commodityId}")
    Result<Commodity> getCommodityById(@PathVariable("commodityId") Integer commodityId);

    @GetMapping("/merchant/toppings/list")
    Result<List<Toppings>> getToppingsByIds(@RequestParam("toppingsIds") List<Integer> toppingsIds);

}
